<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.a {
				background-color: red;
				width: 100px;
				height: 400px;
				display: none;
			}
		</style>
	</head>
	<body>
		<button onclick="hidden()">显式隐藏</button>
		<div id="main" class="a"></div>

		<script>
			function hidden(){
				if(document.getElementById('main').style.display == 'block')
				{
					document.getElementById('main').style.display = 'none';
				}
				else
				{
					document.getElementById('main').style.display = 'block';
				}
			}
		</script>
	</body>
</html>